Skip to content

Extract backend tests workflow and remove docker layer#4635

Merged
arkid15r merged 10 commits into
OWASP:feature/ci-cd-optimizationfrom
ahmedxgouda:ci/backend-tests
May 12, 2026
Merged

Extract backend tests workflow and remove docker layer#4635
arkid15r merged 10 commits into
OWASP:feature/ci-cd-optimizationfrom
ahmedxgouda:ci/backend-tests

Conversation

@ahmedxgouda
Copy link
Copy Markdown
Collaborator

Proposed change

Resolves #4634

Extracted backend tests workflow and removed docker layer

Checklist

  • Required: I followed the contributing workflow
  • Required: I verified that my code works as intended and resolves the issue as described
  • Required: I ran make check-test locally: all warnings addressed, tests passed
  • I used AI for code, documentation, tests, or communication related to this PR

@github-actions github-actions Bot added the ci label May 10, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 10, 2026

Review Change Stack

Summary by CodeRabbit

  • Chores
    • Refactored internal CI/CD pipeline infrastructure to improve maintainability and reduce code duplication in automated testing processes.

Walkthrough

Extracts backend test steps into a reusable run-backend-tests workflow that installs Poetry, caches dependencies and virtualenv, runs unit tests after sourcing .env.example, uploads coverage, and updates the main CI job to call this workflow.

Changes

Backend Tests Workflow Extraction

Layer / File(s) Summary
Reusable Workflow Definition
.github/workflows/run-backend-tests.yaml
New workflow_call workflow adding run-unit-tests (checkout, install Poetry, setup Python 3.13 with caching keyed to backend/poetry.lock, cache backend/.venv, poetry install --no-interaction, poetry run pytest tests/unit after sourcing .env.example, upload backend/coverage.xml as coverage-xml) and upload-coverage-to-codecov job (downloads artifact, uploads to Codecov with use_oidc: true, fail_ci_if_error: false). Both jobs set job-level permissions and 5-minute timeouts.
Workflow Integration
.github/workflows/run-ci-cd.yaml
run-backend-tests job refactored from inline Docker-based steps to uses: ./.github/workflows/run-backend-tests.yaml and now sets permissions for actions, contents, and id-token.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • OWASP/Nest#4623: Refactors CI by extracting inline jobs into reusable workflows and updates run-ci-cd.yaml job wiring.

Suggested labels

backend, docker

Suggested reviewers

  • arkid15r
  • kasya
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and specifically summarizes the main changes: extracting the backend tests workflow and removing the Docker layer, which are the primary objectives.
Description check ✅ Passed The PR description is directly related to the changeset, explaining the extraction of the backend tests workflow and removal of the Docker layer, referencing issue #4634.
Linked Issues check ✅ Passed The PR successfully implements both requirements from issue #4634: extracting the backend tests workflow into a separate file (.github/workflows/run-backend-tests.yaml) and removing the Docker layer by running tests directly with Poetry.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the linked issue objectives; modifications only involve workflow extraction and Docker removal without introducing unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes May 10, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Confidence score: 2/5

  • There is a high-confidence, high-severity CI risk in .github/workflows/run-ci-cd.yaml: run-backend-tests is called without job-level permissions while top-level permissions: {} is set.
  • This can block the reusable workflow from getting required contents: read and id-token: write scopes, making backend test execution and related pipeline steps likely to fail.
  • Given the concrete misconfiguration and likely pipeline regression, this is higher merge risk until permissions are explicitly set on the job call.
  • Pay close attention to .github/workflows/run-ci-cd.yaml - missing job-level permissions can prevent the called workflow from obtaining required scopes.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/run-ci-cd.yaml">

<violation number="1" location=".github/workflows/run-ci-cd.yaml:38">
P1: The reusable `run-backend-tests` call is missing job-level `permissions`, so with top-level `permissions: {}` the called workflow cannot obtain its required `contents: read` and `id-token: write` scopes.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread .github/workflows/run-ci-cd.yaml
@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.92%. Comparing base (d373f32) to head (f02178f).

Additional details and impacted files

Impacted file tree graph

@@                     Coverage Diff                     @@
##           feature/ci-cd-optimization    #4635   +/-   ##
===========================================================
  Coverage                       98.92%   98.92%           
===========================================================
  Files                             528      528           
  Lines                           16968    16968           
  Branches                         2416     2416           
===========================================================
  Hits                            16785    16785           
  Misses                             98       98           
  Partials                           85       85           
Flag Coverage Δ
frontend 97.28% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d373f32...f02178f. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 10, 2026
cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes May 10, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes May 10, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 2 files (changes from recent commits).

@ahmedxgouda ahmedxgouda marked this pull request as ready for review May 10, 2026 13:20
Comment thread .github/workflows/run-backend-tests.yaml
Comment thread .github/workflows/run-backend-tests.yaml Outdated
Comment thread .github/workflows/run-backend-tests.yaml
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/run-backend-tests.yaml">

<violation number="1" location=".github/workflows/run-backend-tests.yaml:36">
P2: The cache path points to the wrong directory. Poetry creates the venv in `backend/.venv`, so caching `./.venv` won’t cache the environment used by tests.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Comment thread .github/workflows/run-backend-tests.yaml Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/run-backend-tests.yaml:
- Line 44: The workflow contains an unused command "touch
.venv/dependencies_installed" which creates a file never referenced later;
remove that line from the run-backend-tests.yaml job to clean up dead code
(search for the exact string "touch .venv/dependencies_installed" and delete the
command).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0835ca37-82c9-449c-b787-a3b1261d2190

📥 Commits

Reviewing files that changed from the base of the PR and between 5fb5e82 and a81f78c.

📒 Files selected for processing (2)
  • .github/workflows/run-backend-tests.yaml
  • .github/workflows/run-ci-cd.yaml

Comment thread .github/workflows/run-backend-tests.yaml Outdated
cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes May 11, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes May 11, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

@ahmedxgouda ahmedxgouda requested review from Wandji69 and arkid15r May 11, 2026 17:22
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 11, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 11, 2026
cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes May 11, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes May 11, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 1 file (changes from recent commits).

@arkid15r arkid15r dismissed cubic-dev-ai[bot]’s stale review May 12, 2026 01:08

The merge-base changed after approval.

@arkid15r arkid15r force-pushed the feature/ci-cd-optimization branch 2 times, most recently from a038c90 to 5fb5e82 Compare May 12, 2026 01:09
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/run-backend-tests.yaml:
- Line 23: Replace the unpinned pipx install poetry invocation with a pinned
install using a specific Poetry version (i.e., change the plain "pipx install
poetry" invocation to a fixed-version invocation such as pipx install
poetry==<version>), and make the same change for the identical pipx install line
present in the other CI workflow files so all workflows use the same
deterministic Poetry version.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1cdf832e-63f1-4ae3-9757-d5ff21fae2b8

📥 Commits

Reviewing files that changed from the base of the PR and between 9863bfe and f02178f.

📒 Files selected for processing (2)
  • .github/workflows/run-backend-tests.yaml
  • .github/workflows/run-ci-cd.yaml

Comment thread .github/workflows/run-backend-tests.yaml
@ahmedxgouda
Copy link
Copy Markdown
Collaborator Author

@arkid15r Updates are merged now.

@arkid15r arkid15r merged commit f9ac93a into OWASP:feature/ci-cd-optimization May 12, 2026
39 checks passed
@ahmedxgouda ahmedxgouda added the gsoc2026:ahmedxgouda ahmedxgouda's GSoC 2026 related work label May 14, 2026
@ahmedxgouda ahmedxgouda deleted the ci/backend-tests branch May 18, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci gsoc2026:ahmedxgouda ahmedxgouda's GSoC 2026 related work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants